package ThreadPool;

import java.util.concurrent.*;

/**
 * @author wang'ji'cheng
 * @date 2025/7/23
 */
public class ThreadDemo6 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {

        ThreadPoolExecutor pool = new ThreadPoolExecutor(2,5,2, TimeUnit.SECONDS,new ArrayBlockingQueue<>(10), Executors.defaultThreadFactory(),new ThreadPoolExecutor.AbortPolicy());

        Future<?> submit = pool.submit(new Runnable1());
        System.out.println(submit.get());
    }
}
